<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
  String xm = this.getServletContext().getInitParameter("path");
	String path1 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+xm;
%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万达营销流程管理系统</title>
<base target="_self" />

<link href="<%=path1 %>/qt/css/css.css" rel="stylesheet" type="text/css" />

<!-- <link href="Styles/css.css" rel="stylesheet" type="text/css" />
<link href="Styles/ts_css.css" rel="stylesheet" type="text/css" /> -->
<script src="<%=path1 %>/qt/Scripts/My97DatePicker/WdatePicker.js"
	type="text/javascript"></script>
<script src="<%=path1 %>/qt/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="<%=path1 %>/qt/Scripts/IndexManager.js" type="text/javascript"></script>

<script type="text/javascript">
	function MM_jumpMenu(targ, selObj, restore) { //v3.0
		eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value
				+ "'");
		if (restore)
			selObj.selectedIndex = 0;
	}
</script>

<script type="text/javascript">
	//添加
	function ajaxPost() {
		$(document)
		   .ready(function() {
			   $.ajax({
				    data : {
							opening_report_id : $("#opening_report_id").val(),
							opening_report_time : $("#opening_report_time").val(),
							project_id : $("#project_id").val(),
							//pay_type_id:$("#pay_type_id").val(),
							//room_id:$("#room_id").val(),
							state : $("#state").val(),
							price_type : $("input=[name='price_type']:checked").val(),
							opening_report_name : $("#opening_report_name").val(),
							report_type : $("#report_type").val(),
							opening_report_description : $("#opening_report_description").val(),
							discount:$("#discount").val(),
							dingjin : $("#dingjin").val(),
							xuke : $("#xuke").val(),
							telidiscount:$("#telidiscount").val()
							},
					type : "post",
					dataType : 'json',
					url : "http://localhost:8080/wanda_java2/ht/report/insert",
					error : function(data) {
						//alert("出错了");
					},
					success : function(data) {
					   //alert("开盘添加成功");
					// window.location.href="http://localhost:8080/wanda_java2/qt/ht/room/selectAlls.do?project_id="+abc;   
					}

				});
		 });
	}
</script>
<script type="text/javascript">
	//项目查询
	var abc;
	$(document).ready(
		function() {
			$.ajax({
					url : "<%=path1%>/qt/ht/project/selectAlls.do",
					datatype : 'json',
					error : function(data) {
					alert("出错了！！");
					},
					success : function(data) {
                    var len = data.msg.length;
					var html = "";
					if (len > 0) {
					   data.msg.forEach(function(e) {
					   html += "<option value="+e.project_id+">"+ e.project_name+ "</option>";
					   })
						//alert(html);
						$("#project_id").append(html);

						}
					}
			   });
		});
</script>
<script type="text/javascript">
	//就是用两种方法试试（js\jquery）
	function opening_report_names() {
		var opening = document.getElementById("opening_report_name").value;
		if (opening == "" || opening == null) {
			//alert("报告名称不能为空");
			//opening_report_name.focus();
			return false;
		}
		return true;
	}
	function report_types() {
		var report = $("#report_type").val();
		if (report == "" || report == null) {
			//alert("报告类型不能为空");
			// $("#report_type").focus();
			return false;
		}
		return true;
	}

	function xukes() {
		var xuke = $("#xuke").val();
		if (xuke == "" || xuke == null) {
			//alert("蓄客不能为空");
			// $("#xuke").focus();
			return false;
		}
		return true;
	}
	function dingjins() {
		var dingjin = $("#dingjin").val();
		if (dingjin == "" || dingjin == null) {
			//alert("定金不能为空");
			//$("#dingjin").focus();
			return false;
		}
		return true;
	}

	function opening_report_descriptions() {
		var opening_report = $("#opening_report_description").val();
		if (opening_report == "" || opening_report == null) {
			//alert("开盘报告说明");
			// $("#opening_report_descriptions").focus();
			return false;
		}
		return true;
	}
</script>
<script type="text/javascript">
	function addopeningrooms() {
		if (opening_report_names() == true & report_types() == true & xukes() == true
				& dingjins() == true & opening_report_descriptions() == true) {
			abc = $("#project_id").val();
			//alert("项目id是啥了：" + abc);
			// bcd= $("price_type").val();
			window.location.href = "<%=path1%>/qt/ht/room/selectAlls.do?project_id="
					+ abc;
		}else{
			alert("红色星号为必填项！");
		}
	}
</script>
</head>
<body>
	<div class="yboxwidth boxcenter">
		<div class="ybox09">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td class="ybox10td1"><a href="#"><img
							src="./images/op8_1.gif" width="28" height="54" /></a></td>
					<td><table border="0" cellspacing="0" cellpadding="0">
							<tr valign="top">
								<td class="ybox11td5"></td>
								<td class="ybox11td6"><a
									href="#">1、填写基本信息</a></td>
								<td class="ybox11td7"></td>
								<td class="ybox11td2"><a href="<%=path1%>/qt/addOpeningRoom.jsp">2、选择房间</a></td>
								<td class="ybox11td3"></td>
								<td class="ybox11td2"><a href="<%=path1%>/qt/addOpeningRooms.jsp">3、导入价格</a></td>
								<td class="ybox11td3"></td>
								<td class="ybox11td2"><a href="<%=path1%>/qt/zheKou.jsp">4、引入折扣方案</a></td>
								<td class="ybox11td3"></td>
								<td class="ybox11td2"><a href="<%=path1%>/ht/pay_type/selectAllss.do">5、引入付款方式</a></td>
								<td class="ybox11td3"></td>
								<td class="ybox11td2"><a href="<%=path1%>/qt/yuLan.jsp">6、预览并提交</a></td>
								<td class="ybox11td4"></td>

							</tr>
						</table></td>
					<td class="ybox10td1"><a href="#"><img
							src="./images/op8_2.gif" width="28" height="54" /></a></td>
				</tr>
			</table>
		</div>
		<div class="ybox02">
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				class="margb4">
				<tr>
					<td class="ybox03td1"></td>
					<td class="ybox03td2"></td>
					<td class="ybox03td3"></td>
				</tr>
				<tr>
					<td class="ybox03td4"></td>
					<td class="ybox03td5"><div class="ybox05 margb8">
							<dl>
								<dt>
									<strong>【注】</strong> 红色（*）号为必填字段，填完后方能进行下一步操作。
								</dt>
							</dl>
						</div>
						<table width="100%" border="0" cellpadding="0" cellspacing="1"
							class="ybox04table">
							<tr>
								<td width="15%" class="ybox04tdl"><span class="red">*</span>
									项目名称</td>
								<td width="18%" class="ybox04tdr"><select name="project_id"
									type="text" class="black12" id="project_id" style="width: 90%;"></select></td>
								<td width="15%" class="ybox04tdl"><span class="red">*</span>
									报告名称</td>
								<td width="18%" class="ybox04tdr"><input type="text"
									name="opening_report_name" id="opening_report_name"
									onblur="opening_report_names();" /></td>
								<td width="15%" class="ybox04tdl"><span class="red">*</span>
									报告类型</td>
								<td width="19%" class="ybox04tdr"><input name="report_type"
									type="text" class="black12" id="report_type"
									onblur="report_types()" style="width: 90%;" /></td>
							</tr>
							<tr>
								<td class="ybox04tdl"><span class="red">*</span> 计价方式</td>
								<td colspan="5" class="ybox04tdr"><input type="radio"
									name="price_type" id="price_type" value="建筑面积"
									checked="checked" /> 建筑面积 </label> &nbsp;&nbsp; <label> <input
										type="radio" name="price_type" id="price_type" value="套内面积" />
										套内面积
								</label> &nbsp;&nbsp; <label> <input type="radio"
										name="price_type" id="price_type" value="套" /> 套
								</label></td>

							</tr>
							<tr>
								<td class="ybox04tdl"><span class="red">*</span> 综合折扣率(%)</td>
								<td class="ybox04tdr"><input readonly="readonly" name="discount" id="discount" value="92.00"></td>
								<td class="ybox04tdl"><span class="red">*</span> 特例折扣比例(%)</td>
								<td class="ybox04tdr"><input readonly="readonly" name="" id="" value="0.2"></td>
								
								<td class="ybox04tdl">状态</td>
								<td class="ybox04tdr"><input readonly="readonly"
									value="审核中" name="state" id="state" /></td>
								
							</tr>
							<!-- <tr>
							//没有这个字段
								<td class="ybox04tdl"><span class="red">*</span> 价格标准</td>
								<td colspan="5" class="ybox04tdr">
										<label> <input type="radio" name="RadioGroup1"
											id="RadioGroup1_0" /> 以建筑单价为准
										</label> &nbsp;&nbsp; <label> <input type="radio"
											name="RadioGroup1" id="RadioGroup1_1" /> 以套内单价为准
										</label> &nbsp;&nbsp; <label> <input type="radio"
											name="RadioGroup1" id="RadioGroup1_1" /> 以标准总价为准
										</label>
									</td>
							</tr> 
							<tr>
								<td class="ybox04tdl"><span class="red">*</span> 已售房间</td>
								<td colspan="5" class="ybox04tdr"><form id="form1"
										name="form1" method="post" action="">
										<label> <input type="radio" name="RadioGroup1"
											id="RadioGroup1_0" /> 不参与调价
										</label> &nbsp;&nbsp; <label> <input type="radio"
											name="RadioGroup1" id="RadioGroup1_1" /> 参与调价
										</label>
									</form></td>
								<tr>-->
							<td class="ybox04tdl"><span class="red">*</span> 蓄客情况分析</td>
							<td colspan="5" class="ybox04tdr"><textarea name="xuke"
									rows="6" class="black12" id="xuke" onblur="xukes()"
									style="width: 99.5%;"></textarea></td>
							<tr>
								<td class="ybox04tdl"><span class="red">*</span> 定金收取方案</td>
								<td colspan="5" class="ybox04tdr"><textarea name="dingjin"
										rows="6" class="black12" id="dingjin" onblur="dingjins()"
										style="width: 99.5%;"></textarea></td>
							</tr>
							<tr>
								<td class="ybox04tdl"><span class="red">*</span> 开盘报告说明</td>
								<td colspan="5" class="ybox04tdr"><textarea
										name="opening_report_description" rows="6" class="black12"
										id="opening_report_description"
										onblur="opening_report_descriptions();" style="width: 99.5%;"></textarea></td>
							</tr>
						</table></td>
					<td class="ybox03td6"></td>
				</tr>
				<tr>
					<td class="ybox03td7"></td>
					<td class="ybox03td8"></td>
					<td class="ybox03td9"></td>
				</tr>
			</table>
			<table width="380" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td height="60" align="center"><a
						onclick="addopeningrooms();ajaxPost()"><img
							src="./images/botton02.gif" width="95" height="34" /></a></td>
				</tr>
			</table>
		</div>
	</div>
</body>
</html>
